<?php


namespace App\Http\Model\Auth;


use Illuminate\Support\Facades\DB;

class AuthModel
{

    /**
     * 根据业务线过滤监管账户ID
     *
     * @param $enumId
     * @param $pfsId
     *
     * @return string
     */
    public static function pfsId($enumId, $pfsId)
    {
        $enumIdInt = [];
        foreach ($enumId as $val) {
            $enumIdInt[] = (int) $val;
        }
        $enumIdInt = implode(',', $enumIdInt);
        $data = DB::select("SELECT GROUP_CONCAT(id) as pfs_id FROM `pfs_dw_ini` WHERE id IN ($pfsId) AND `enum_id` IN ($enumIdInt) AND `is_del`=0");
        return empty($data) ? '' : current($data)->pfs_id;
    }

}





/**
 * AuthModel.php
 *
 * 说明:
 *
 * 修改历史
 * ----------------------------------------
 * 2021/6/11 16:55:00   操作:创建
 **/
